﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PetaPoco;
using MVC.Music.Data.Interfaces;
namespace MVC.Music.Data.Repositories
{
    public abstract class BaseRepository<T> : IRepository<T> where T : class
    {
        protected PetaPoco.Database _database;

        public BaseRepository(PetaPoco.Database database)
        {
            _database = database;
        }

        public abstract T Single(object primaryKey);
       

        public abstract IEnumerable<T> Query();
      
        public abstract List<T> Fetch();


        public abstract Page<T> PagedQuery(long pageNumber, long itemsPerPage, string sql, params object[] args);
       

        public abstract int Insert(object itemToAdd);
       

        public abstract int Update(object itemToUpdate, object primaryKeyValue);
       

        public abstract int Delete(object primaryKeyValue);
        
    }
}
